Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Oct 11, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2025

🦋 Changeset detected

Latest commit: c8a89a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
pgflow Minor
@pgflow/edge-worker Minor
@pgflow/client Minor
@pgflow/core Minor
@pgflow/dsl Minor
@pgflow/example-flows Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor Author

jumski commented Oct 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nx-cloud
Copy link

nx-cloud bot commented Oct 11, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit c8a89a2

Command Status Duration Result
nx affected -t lint typecheck test --parallel -... ❌ Failed 7m 5s View ↗
nx affected -t test:e2e --parallel --base=origi... ✅ Succeeded 6m 22s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-23 00:28:12 UTC

@github-actions
Copy link
Contributor

🔍 Preview Deployment: Playground

Deployment successful!

🔗 Preview URL: https://pr-253--pgflow-demo.netlify.app

📝 Details:

  • Branch: feat-auto-compilation
  • Commit: b110c092ab1d460059993a00f02f0c5c66288c7e
  • View Logs

_Last updated: _

@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-253.pgflow.pages.dev

📝 Details:

  • Branch: feat-auto-compilation
  • Commit: a30bad4fa923611bfa23cc3dbd2209f9b74b569f
  • View Logs

_Last updated: _

@jumski jumski force-pushed the feat-auto-compilation branch from 56ed82d to dcd753f Compare November 20, 2025 17:21
Comment on lines +108 to +122
const errorData = await response.json();
throw new Error(
`Flow '${flowSlug}' not found.\n\n` +
`${errorData.message || 'Did you add it to flows.ts?'}\n\n` +
`Fix:\n` +
`1. Add your flow to supabase/functions/pgflow/flows.ts\n` +
`2. Restart edge functions: supabase functions serve`
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 404 error handling assumes all 404 responses mean the flow wasn't registered, but the ControlPlane server regex /^/flows/([a-zA-Z0-9_]+)$/ only accepts alphanumeric characters and underscores. If a user passes a slug with hyphens like my-flow, the route won't match and returns a generic 404 with "Route GET /flows/my-flow not found". This code will misleadingly tell users to add the flow to flows.ts when the real issue is invalid characters in the slug.

if (response.status === 404) {
  const errorData = await response.json();
  // Check if it's a route mismatch vs missing flow
  if (errorData.error === 'Not Found' && errorData.message.includes('Route')) {
    throw new Error(
      `Invalid flow slug: '${flowSlug}'\n\n` +
        `Flow slugs can only contain letters, numbers, and underscores.\n` +
        `Example: my_flow (not my-flow)`
    );
  }
  throw new Error(
    `Flow '${flowSlug}' not found.\n\n` +
      `${errorData.message || 'Did you add it to flows.ts?'}\n\n` +
      `Fix:\n` +
      `1. Add your flow to supabase/functions/pgflow/flows.ts\n` +
      `2. Restart edge functions: supabase functions serve`
  );
}
Suggested change
const errorData = await response.json();
throw new Error(
`Flow '${flowSlug}' not found.\n\n` +
`${errorData.message || 'Did you add it to flows.ts?'}\n\n` +
`Fix:\n` +
`1. Add your flow to supabase/functions/pgflow/flows.ts\n` +
`2. Restart edge functions: supabase functions serve`
);
}
const errorData = await response.json();
// Check if it's a route mismatch vs missing flow
if (errorData.error === 'Not Found' && errorData.message.includes('Route')) {
throw new Error(
`Invalid flow slug: '${flowSlug}'\n\n` +
`Flow slugs can only contain letters, numbers, and underscores.\n` +
`Example: my_flow (not my-flow)`
);
}
throw new Error(
`Flow '${flowSlug}' not found.\n\n` +
`${errorData.message || 'Did you add it to flows.ts?'}\n\n` +
`Fix:\n` +
`1. Add your flow to supabase/functions/pgflow/flows.ts\n` +
`2. Restart edge functions: supabase functions serve`
);
}

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@jumski jumski force-pushed the feat-auto-compilation branch from dcd753f to 0d80511 Compare November 21, 2025 09:16
Comment on lines +45 to +46
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sed -i flag behaves differently on macOS vs Linux. On macOS, it requires a backup extension argument (e.g., sed -i ''), while on Linux it doesn't. This will cause the script to fail for developers on macOS.

# Fix for cross-platform compatibility:
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete
Suggested change
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} + && find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -delete

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@jumski jumski force-pushed the feat-auto-compilation branch 3 times, most recently from 57c098c to a947cb7 Compare November 21, 2025 16:47
@jumski jumski force-pushed the feat-auto-compilation branch from a947cb7 to c8a89a2 Compare November 23, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants